/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CoreKhjgb extends BasicModel<CoreKhjgb> {
  khjgbYcdw?: string; // 用车单位
  khjgbCllx?: string; // 车辆类型
  khjgbZlfs?: string; // 租赁方式
  khjgbJcj?: string; // 基础价
  khjgbJcgl?: number; // 基础公里
  khjgbJcsz?: number; // 基础时长
  khjgbCgldj?: number; // 超公里单价
  khjgbCsdj?: number; // 超时单价
  khjgbValid?: string; // 生效日期
  khjgbInvalid?: string; // 失效日期
  createByName?: string; // 创建者名称
  updateByName?: string; // 更新者名称
}

export const coreKhjgbList = (params?: CoreKhjgb | any) =>
  defHttp.get<CoreKhjgb>({ url: adminPath + '/bas/cus/coreKhjgb/list', params });

export const coreKhjgbListData = (params?: CoreKhjgb | any) =>
  defHttp.post<Page<CoreKhjgb>>({ url: adminPath + '/bas/cus/coreKhjgb/listData', params });

export const coreKhjgbForm = (params?: CoreKhjgb | any) =>
  defHttp.get<CoreKhjgb>({ url: adminPath + '/bas/cus/coreKhjgb/form', params });

export const coreKhjgbSave = (params?: any, data?: CoreKhjgb | any) =>
  defHttp.postJson<CoreKhjgb>({ url: adminPath + '/bas/cus/coreKhjgb/save', params, data });

export const coreKhjgbImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/bas/cus/coreKhjgb/importData',
      onUploadProgress,
    },
    params,
  );

export const coreKhjgbDelete = (params?: CoreKhjgb | any) =>
  defHttp.get<CoreKhjgb>({ url: adminPath + '/bas/cus/coreKhjgb/delete', params });


export const coreKhjgbGetKhjgb = (params?: CoreKhjgb | any) =>
  defHttp.get<CoreKhjgb>({ url: adminPath + '/bas/cus/coreKhjgb/getKhjgb', params });
